<#include "../macros/utils.ftl" />
<#include "./includes/utils.ftl" />
<#import "../macros/spring.ftl" as spring />


<#macro objList>
    <#if m_site.in_index?? || m_site.in_count??>
      <#assign in_index = m_site.in_index?number />
      <#assign in_count = m_site.in_count?number />

      <#if m_site.m_usersList?size gt 0 >
          <#assign counter = 0 /> 
            <#list getList(m_site.m_usersList) as user>
                  <#assign counter = counter + 1 />
                  <#if (counter >= in_index) && (counter < (in_index + in_count))>
                      <@userItem user />
                  </#if>
            </#list>

        <#assign currentCount = in_index + in_count />
        <#if (counter > currentCount-1)>
          <div class="clear load-more">
            <form action="<@spring.url '/users/loadmore' />" method="POST">
                <input type="hidden" name="index" value="${(m_site.in_index + m_site.in_count)?c}">
                <input type="hidden" name="count" value="${m_site.in_count}">
                <input type="hidden" name="content" value="${m_site.in_content!""}">
                <input type="hidden" name="filter" value="${m_site.in_filter!""}">
            </form>
            <a href="" class="btn-load"  data-wt="true">load More</a>
          </div> 
        </#if>
      <#else>
        <div class="alert alert-warning">
          <strong> Sorry</strong>, no users at this time.
        </div>
      </#if>
    </#if>
</#macro>

<@objList />

<script type="text/javascript">
    base.init();
</script>